package com.cskaoyan.shopping.service.impl.remote;

import com.cskaoyan.mall.dto.ItemDto;
import com.cskaoyan.shopping.converter.ProductConverter;
import com.cskaoyan.shopping.dal.persistence.ItemMapper;
import com.cskaoyan.shopping.service.IProductApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author raccoon@littleraccoon.xyz
 * @since 2022/12/12 20:04
 */
@Service
public class IProductApiImpl implements IProductApiService {
    @Autowired
    ItemMapper itemMapper;
    @Autowired
    ProductConverter productConverter;

    @Override
    public List<ItemDto> getAllProductItem() {
        return productConverter.items2ItemDtos(itemMapper.selectAll());
    }
}
